\(\int \sqrt {3-x} \sqrt {-2+x} \, dx\) [1161]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 51 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\frac {1}{4} \sqrt {3-x} \sqrt {-2+x}-\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}-\frac {1}{8} \arcsin (5-2 x) \]

[Out]

1/8*arcsin(-5+2*x)-1/2*(3-x)^(3/2)*(-2+x)^(1/2)+1/4*(3-x)^(1/2)*(-2+x)^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {52, 55, 633, 222} \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=-\frac {1}{8} \arcsin (5-2 x)-\frac {1}{2} \sqrt {x-2} (3-x)^{3/2}+\frac {1}{4} \sqrt {x-2} \sqrt {3-x} \]

[In]

Int[Sqrt[3 - x]*Sqrt[-2 + x],x]

[Out]

(Sqrt[3 - x]*Sqrt[-2 + x])/4 - ((3 - x)^(3/2)*Sqrt[-2 + x])/2 - ArcSin[5 - 2*x]/8

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 55

Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_.) + (d_.)*(x_)]), x_Symbol] :> Int[1/Sqrt[a*c - b*(a - c)*x - b^2*x^2]
, x] /; FreeQ[{a, b, c, d}, x] && EqQ[b + d, 0] && GtQ[a + c, 0]

Rule 222

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSin[Rt[-b, 2]*(x/Sqrt[a])]/Rt[-b, 2], x] /; FreeQ[{a, b}
, x] && GtQ[a, 0] && NegQ[b]

Rule 633

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[1/(2*c*(-4*(c/(b^2 - 4*a*c)))^p), Subst[Int[Si
mp[1 - x^2/(b^2 - 4*a*c), x]^p, x], x, b + 2*c*x], x] /; FreeQ[{a, b, c, p}, x] && GtQ[4*a - b^2/c, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}+\frac {1}{4} \int \frac {\sqrt {3-x}}{\sqrt {-2+x}} \, dx \\ & = \frac {1}{4} \sqrt {3-x} \sqrt {-2+x}-\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}+\frac {1}{8} \int \frac {1}{\sqrt {3-x} \sqrt {-2+x}} \, dx \\ & = \frac {1}{4} \sqrt {3-x} \sqrt {-2+x}-\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}+\frac {1}{8} \int \frac {1}{\sqrt {-6+5 x-x^2}} \, dx \\ & = \frac {1}{4} \sqrt {3-x} \sqrt {-2+x}-\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}-\frac {1}{8} \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2}} \, dx,x,5-2 x\right ) \\ & = \frac {1}{4} \sqrt {3-x} \sqrt {-2+x}-\frac {1}{2} (3-x)^{3/2} \sqrt {-2+x}-\frac {1}{8} \sin ^{-1}(5-2 x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\frac {1}{4} \sqrt {-6+5 x-x^2} \left (-5+2 x-\frac {\text {arctanh}\left (\frac {1}{\sqrt {\frac {-3+x}{-2+x}}}\right )}{\sqrt {-3+x} \sqrt {-2+x}}\right ) \]

[In]

Integrate[Sqrt[3 - x]*Sqrt[-2 + x],x]

[Out]

(Sqrt[-6 + 5*x - x^2]*(-5 + 2*x - ArcTanh[1/Sqrt[(-3 + x)/(-2 + x)]]/(Sqrt[-3 + x]*Sqrt[-2 + x])))/4

Maple [A] (verified)

Time = 0.36 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.20

method result size
default \(\frac {\sqrt {3-x}\, \left (-2+x \right )^{\frac {3}{2}}}{2}-\frac {\sqrt {3-x}\, \sqrt {-2+x}}{4}+\frac {\sqrt {\left (-2+x \right ) \left (3-x \right )}\, \arcsin \left (-5+2 x \right )}{8 \sqrt {-2+x}\, \sqrt {3-x}}\) \(61\)
risch \(-\frac {\left (-5+2 x \right ) \left (-3+x \right ) \sqrt {-2+x}\, \sqrt {\left (-2+x \right ) \left (3-x \right )}}{4 \sqrt {-\left (-3+x \right ) \left (-2+x \right )}\, \sqrt {3-x}}+\frac {\sqrt {\left (-2+x \right ) \left (3-x \right )}\, \arcsin \left (-5+2 x \right )}{8 \sqrt {-2+x}\, \sqrt {3-x}}\) \(76\)

[In]

int((3-x)^(1/2)*(-2+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*(3-x)^(1/2)*(-2+x)^(3/2)-1/4*(3-x)^(1/2)*(-2+x)^(1/2)+1/8*((-2+x)*(3-x))^(1/2)/(-2+x)^(1/2)/(3-x)^(1/2)*ar
csin(-5+2*x)

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.02 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\frac {1}{4} \, {\left (2 \, x - 5\right )} \sqrt {x - 2} \sqrt {-x + 3} - \frac {1}{8} \, \arctan \left (\frac {{\left (2 \, x - 5\right )} \sqrt {x - 2} \sqrt {-x + 3}}{2 \, {\left (x^{2} - 5 \, x + 6\right )}}\right ) \]

[In]

integrate((3-x)^(1/2)*(-2+x)^(1/2),x, algorithm="fricas")

[Out]

1/4*(2*x - 5)*sqrt(x - 2)*sqrt(-x + 3) - 1/8*arctan(1/2*(2*x - 5)*sqrt(x - 2)*sqrt(-x + 3)/(x^2 - 5*x + 6))

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 2.57 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.43 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\begin {cases} - \frac {i \operatorname {acosh}{\left (\sqrt {x - 2} \right )}}{4} + \frac {i \left (x - 2\right )^{\frac {5}{2}}}{2 \sqrt {x - 3}} - \frac {3 i \left (x - 2\right )^{\frac {3}{2}}}{4 \sqrt {x - 3}} + \frac {i \sqrt {x - 2}}{4 \sqrt {x - 3}} & \text {for}\: \left |{x - 2}\right | > 1 \\\frac {\operatorname {asin}{\left (\sqrt {x - 2} \right )}}{4} - \frac {\left (x - 2\right )^{\frac {5}{2}}}{2 \sqrt {3 - x}} + \frac {3 \left (x - 2\right )^{\frac {3}{2}}}{4 \sqrt {3 - x}} - \frac {\sqrt {x - 2}}{4 \sqrt {3 - x}} & \text {otherwise} \end {cases} \]

[In]

integrate((3-x)**(1/2)*(-2+x)**(1/2),x)

[Out]

Piecewise((-I*acosh(sqrt(x - 2))/4 + I*(x - 2)**(5/2)/(2*sqrt(x - 3)) - 3*I*(x - 2)**(3/2)/(4*sqrt(x - 3)) + I
*sqrt(x - 2)/(4*sqrt(x - 3)), Abs(x - 2) > 1), (asin(sqrt(x - 2))/4 - (x - 2)**(5/2)/(2*sqrt(3 - x)) + 3*(x -
2)**(3/2)/(4*sqrt(3 - x)) - sqrt(x - 2)/(4*sqrt(3 - x)), True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.75 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\frac {1}{2} \, \sqrt {-x^{2} + 5 \, x - 6} x - \frac {5}{4} \, \sqrt {-x^{2} + 5 \, x - 6} + \frac {1}{8} \, \arcsin \left (2 \, x - 5\right ) \]

[In]

integrate((3-x)^(1/2)*(-2+x)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(-x^2 + 5*x - 6)*x - 5/4*sqrt(-x^2 + 5*x - 6) + 1/8*arcsin(2*x - 5)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.82 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\frac {1}{4} \, {\left (2 \, x + 3\right )} \sqrt {x - 2} \sqrt {-x + 3} - 2 \, \sqrt {x - 2} \sqrt {-x + 3} + \frac {1}{4} \, \arcsin \left (\sqrt {x - 2}\right ) \]

[In]

integrate((3-x)^(1/2)*(-2+x)^(1/2),x, algorithm="giac")

[Out]

1/4*(2*x + 3)*sqrt(x - 2)*sqrt(-x + 3) - 2*sqrt(x - 2)*sqrt(-x + 3) + 1/4*arcsin(sqrt(x - 2))

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.80 \[ \int \sqrt {3-x} \sqrt {-2+x} \, dx=\left (\frac {x}{2}-\frac {5}{4}\right )\,\sqrt {x-2}\,\sqrt {3-x}-\frac {\ln \left (x-\frac {5}{2}-\sqrt {x-2}\,\sqrt {3-x}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8} \]

[In]

int((x - 2)^(1/2)*(3 - x)^(1/2),x)

[Out]

(x/2 - 5/4)*(x - 2)^(1/2)*(3 - x)^(1/2) - (log(x - (x - 2)^(1/2)*(3 - x)^(1/2)*1i - 5/2)*1i)/8